refactor(bubble-list): simplify grouping logic#305
Conversation
- Remove special-case grouping for array content and rely on role/divider/hidden rules only - Make divider strategy always create single-message groups for divider role and merge messages between dividers - Clarify docs and demos to reflect the simplified grouping behavior and array content display
- Introduced a custom grouping strategy allowing users to switch between grouping messages by time intervals or conversation turns. - Updated demo to reflect new grouping options and improved message examples for clarity. - Added buttons for users to select their preferred grouping mode.
WalkthroughThe pull request enhances the BubbleList component with a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Package Previewpnpm add https://pkg.pr.new/opentiny/tiny-robot/@opentiny/tiny-robot@4a76135 pnpm add https://pkg.pr.new/opentiny/tiny-robot/@opentiny/tiny-robot-kit@4a76135 pnpm add https://pkg.pr.new/opentiny/tiny-robot/@opentiny/tiny-robot-svgs@4a76135 commit: 4a76135 |
🧹 Preview Cleaned UpThe preview deployment has been removed. |

概要
BubbleList分组规则,移除对数组content的特殊处理,让行为完全由role/dividerRole/hidden决定。contentRenderMode="split"下按项拆分的前提条件。主要改动
分组逻辑
consecutive:仅按角色和hidden连续合并。divider:每条分割角色消息单独成组;两个分割角色之间的消息合并为一组。数组内容展示
contentRenderMode === 'split'、content为数组时,数组每一项才单独渲染为一个 box;否则不拆分。list-array-content.vue,演示 split + 单消息组 下数组内容拆分为多个 box 的效果。自定义分组 demo
list-custom-group.vue,通过按钮在两种自定义分组策略间切换:Summary by CodeRabbit
New Features
content-render-modeprop with "split" option to customize array content renderingDocumentation